import request from "@/utils/request";

// 公告列表 rule/1
export const getSkuList = ({ page }) => {
    return request({
        url: `/skus/${page}`,
        method: "get",
    });
};

// 修改状态 /rule/:id/update_status
export const changStatus = (id, data) => {
    console.log(id);
    return request({
        url: `/skus/${id}/update_status`,
        method: "POST",
        data,
    });
};

// 添加内容 /rule

export const addSku = (data) => {
    return request({
        url: `/skus`,
        method: "POST",
        data,
    });
};
// 修改内容
export const editSku = (id, data) => {
    return request({
        url: `/skus/${id}`,
        method: "POST",
        data,
    });
};
// 批量删除
export const delSkus = (ids) => {
    ids = Array.isArray(ids) ? ids : [ids]
    return request({
        url: `/skus/delete_all`,
        method: "POST",
        data: {
            ids
        }
    });
};